using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter34
{
	/// <summary>
	/// Example01: An Electromagnetic Wave
	/// A sinusoidal electromagnetic wave of frequency 40.0 MHz 
	/// travels in free space in the x direction, as in Figure 34.4.
	/// (A)	Determine the wavelength and period of the wave.
	/// (B)	At some point and at some instant, the electric field 
	/// has its maximum value of 750 N/C and is along the y axis. 
	/// Calculate the magnitude and direction of the magnetic 
	/// field at this position and time.
	/// (C)	Write expressions for the space-time variation of 
	/// the components of the electric and magnetic fields for 
	/// this direction.
	/// </summary>
	public class Example01
	{
		public Example01()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.PlaneElectromagneticWave w = new L.PlaneElectromagneticWave();
			w.Frequency = 40.0E6;
			//(A)
			w.FindPeriodFromFrequency();
			w.WaveLength = w.Speed/w.Frequency;
			result+=Convert.ToString(w.WaveLength)+"\r\n";
			result+=Convert.ToString(w.Period)+"\r\n";
            //(B)
			w.ElectricFieldMaximum = 750.0;
			result+=Convert.ToString(w.MagneticFieldMaximum)+"\r\n";
		}	
	}
}
